package com.medical.device.service.impl;

import com.medical.device.Application;
import com.medical.device.entity.WeighingScale;
import com.medical.device.mapper.WeighingScaleMapper;
import com.medical.device.service.IWeighingScaleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yy
 * @since 2020-02-20
 */
@Service
public class WeighingScaleServiceImpl extends ServiceImpl<WeighingScaleMapper, WeighingScale> implements IWeighingScaleService {

    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    @Autowired
    WeighingScaleMapper weighingScaleMapper;

    @Override
    public int add(WeighingScale weighingScale){
        try {
            int result = weighingScaleMapper.insert(weighingScale);
            return result;
        }catch (Exception e){
            logger.error(e.getMessage());
            return 0;
        }

    }

}
